home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Reference Guide
/
C-C++ Interactive Reference Guide.iso
/
c_ref
/
csource2
/
sclib_2
/
2_7
/
v6n7065a.txt
< prev
next >
Wrap
Text File
|
1995-11-01
|
1KB
|
34 lines
/**************************** Listing 1 ****************************/
/******* *******/
/******* Add this code to the declarations section of yref2.y, *******/
/******* between the %{ and %} symbols *******/
/******* *******/
/*********************************************************************/
struct symlist /* Linked list for storing line numbers */
{
int line; /* Line number for this instance */
int decl; /* Declaration = 1, reference = 0 */
struct symlist *next; /* Pointer to next instance */
};
struct tnode
{
char *word; /* Identifier */
int count; /* Total instances */
struct symlist *first; /* Pointer to beginning of line list */
struct symlist *current; /* Pointer to most recent line instance */
struct tnode *left; /* Pointer to left node in tree */
struct tnode *right; /* Pointer to right node in tree */
};
struct tnode *root;
int yn_decl = 0; /* Declaration = 1, reference = 0 */
struct tnode *addtree(struct tnode *, char *);
void treeprint(struct tnode *);
void listprint(struct symlist *, int );
struct tnode *talloc(void);
struct symlist *lalloc(void);